import { cloud } from '@tarojs/taro'

const request = (name, data) => {
	return new Promise((resolve, reject) => {
		cloud
			.callFunction({
				name,
				data,
			})
			.then((res) => resolve(res.result.data))
			.catch((err) => reject(err.errMsg))
	})
}

export default request
